package cn.gok.dao;


import cn.gok.entity.TManager;
import cn.gok.entity.TStudent;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface StudentDao {

    //登录
    TStudent queryStudentByNameAndPassword(@Param("name") String name,@Param("password") String password);

    //管理员登录
    TManager queryManagerByNameAndPassword(@Param("name")String name,@Param("password")String password);

    //通过学生账号查询账号名是否重复
    TStudent queryStudentByStudentName(@Param("name") String name,@Param("id") int id);

    //通过学生电话查询账号名是否重复
    TStudent queryStudentByPhone(@Param("phone") String phone,@Param("id") int id);

    //通过学生账号查询账号名是否重复
    TStudent queryStudentByStudentName1(@Param("name") String name);

    //通过学生电话查询账号名是否重复
    TStudent queryStudentByPhone1(@Param("phone") String phone);

    //更改学生信息
    int updateStudentInfo(@Param("id") int id,@Param("name") String name,@Param("real_name") String realName,@Param("age") int age,@Param("gender") String gender,@Param("phone") String phone,@Param("school") String school);

    //检查密码是否正确
    TStudent queryPasswordByPassword(@Param("password") String password,@Param("id")int id);

    //修改密码
    int updatePasswordByPassword(@Param("password") String password,@Param("id")int id);

    //
    int queryStudentInfoByStudentNameAndQuestion(@Param("stuName")String stuName,@Param("question")String question
            ,@Param("answer")String answer);
    //添加密保
    int addSecurityQuestionAndAnswerInfo(@Param("stuId")int stuId,@Param("question")String question,@Param("answer")
                                         String answer);

    //通过账号查找密保
    List<String> getQuestionById(@Param("stuName")String stuName);

    //验证密保是否正确
    TStudent checkQuestionAndAnswer(@Param("question")String question,@Param("answer")String answer,@Param("studentName")
                                    String studentName);



}

